package com.xxx.springcloud.controller;

import com.xxx.springcloud.service.MessageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

@RestController
public class MessageController {

    @Resource
    private MessageService messageService;

    @GetMapping(value = "/sendMessage")
    public String sendMessage() {
        String msg = UUID.randomUUID().toString();
        boolean result = messageService.send(msg);
        if(result){
            return "发送成功:" + msg;
        } else {
            return "发送失败：" + msg;
        }
    }


}
